home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
polardrw
/
data.z
/
DrawOcxTestDoc.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-04-13
|
3KB
|
118 lines
// DrawOcxTestDoc.cpp : implementation of the CDrawOcxTestDoc class
//
#include "stdafx.h"
#include "DrawOcxTest.h"
#include "DrawOcxTestDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDrawOcxTestDoc
IMPLEMENT_DYNCREATE(CDrawOcxTestDoc, CDocument)
BEGIN_MESSAGE_MAP(CDrawOcxTestDoc, CDocument)
//{{AFX_MSG_MAP(CDrawOcxTestDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDrawOcxTestDoc construction/destruction
CDrawOcxTestDoc::CDrawOcxTestDoc()
{
// TODO: add one-time construction code here
m_strDocumentName = "";
}
CDrawOcxTestDoc::~CDrawOcxTestDoc()
{
}
BOOL CDrawOcxTestDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CDrawOcxTestDoc serialization
void CDrawOcxTestDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CDrawOcxTestDoc diagnostics
#ifdef _DEBUG
void CDrawOcxTestDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CDrawOcxTestDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDrawOcxTestDoc commands
BOOL CDrawOcxTestDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
// We do nothing here, just remember the name of the file to be open.
// Real job is done in CDrawOcxTestView::OnInitialUpdate()
m_strDocumentName = lpszPathName;
return TRUE;
}
BOOL CDrawOcxTestDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
//return CDocument::OnSaveDocument(lpszPathName);
m_strDocumentName = lpszPathName;
POSITION pos = GetFirstViewPosition();
if (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->SendMessage(WM_SAVEDOCUMENT, (WPARAM)0, (LPARAM)0);
}
return TRUE;
}
CString CDrawOcxTestDoc::GetDocumentName()
{
return m_strDocumentName;
}